package org.absolutezero.client.view;

import javax.inject.Inject;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;

public class PageView extends Composite {

	private static PageUiBinder uiBinder = GWT.create(PageUiBinder.class);

	interface PageUiBinder extends UiBinder<Widget, PageView> {
	}

	@UiField(provided=true)
	PageContentView content;
	
	@UiField
	FlowPanel headerButtons;
	
	@UiField
	HTMLPanel rightPanel;
	
	private final NavigationMenuView navigationMenuView;
	
	@Inject
	public PageView(PageContentView content,
				NavigationMenuView navigationMenuView) {
		
		this.content = content;
		this.navigationMenuView = navigationMenuView;
		
		initWidget(uiBinder.createAndBindUi(this));
	}
	
	public PageContentView getContent(){
		return content;
	}
	
	public FlowPanel getHeaderButtons(){
		return headerButtons;
	}
	
	public void showRightPanel(){
		rightPanel.clear();
		rightPanel.add(navigationMenuView);
	}
	
	public void hideRightPanel(){
		rightPanel.clear();
	}
	
}
